require 'test/unit'
require 'database/game_database'

require 'models/entity'

class TCRoom < Entity
end

class GameDatabaseTest < Test::Unit::TestCase
    def setup
    end
    def test_room_database
        room = TCRoom.new
        room.name = "A Room"
        room = RoomDatabase.instance.add(room)

        assert_not_nil(room.oid)
        assert_equal(1,RoomDatabase.instance.size)
    end

    def test_room_retrieve
        room = TCRoom.new
        room.name = "A Room"
        room = RoomDatabase.instance.add(room)

        r = RoomDatabase.instance.find_by_name("A Room")
        assert_not_nil(r)
        assert_equal(room.name,r.name)
    end
end
